package com.atyjh.reggie.utils;

import com.atyjh.reggie.dto.UserDTO;
import com.atyjh.reggie.entity.Employee;

/**
 * @author yjh
 * @since jdk1.8.0_311 2022.06.07
 */
public class UserHolder {

    private static final ThreadLocal<UserDTO> tl = new ThreadLocal<>();

    public static void addUser(UserDTO user) {
        tl.set(user);
    }

    public static UserDTO getUser() {
        return tl.get();
    }

    public static void removeUser() {
        tl.remove();
    }
}
